package com.wash.shoes.controller.mobile;

import com.ruoyi.common.core.domain.R;
import com.wash.shoes.oss.AliyunOSSUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author lijianguo
 * @Date 06/12/2024 21:15
 * 请输入类的简介
 **/
@Api(tags = {"移动端-通用"})
@RestController
@RequestMapping("/mobile-api/common")
public class CommonMController {

    @ApiOperation("上传图片")
    @PostMapping(value = "images/upload")
    R<String> uploadImages(@RequestPart(value = "file") MultipartFile multipartFile) throws IOException {
        return R.ok(AliyunOSSUtil.uploadMFile(multipartFile));
    }


}
